package Demo;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import Util.JDBC;

public class show {
	private Connection coon=null;
	private PreparedStatement state=null;
	private ResultSet rest=null;
	private String sult=null;
	public show() {
		
		
	}
	JDBC jdb=new JDBC();
	public ArrayList<String> showdata(){
		ArrayList<String> arry =new ArrayList<String>();
		coon=jdb.getConnection();
		String sql="SELECT * FROM `employee`";
		 try {
			state=coon.prepareStatement(sql);
			rest=state.executeQuery();
			while(rest.next()) {
				arry.add(rest.getString(2));
				arry.add(rest.getString(3));
				arry.add(rest.getString(4));
				arry.add(rest.getString(5));
				arry.add(rest.getString(6));
				arry.add(rest.getString(7));
			}
			jdb.closeAll(coon, state, rest);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return arry;
	}
	

}
